<!doctype html>
<html>
<head>
<meta charset="UTF-8" />
<title>兑换商品管理</title>  
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" />
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Wx/css/base.css" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Wx/css/add.css" />
</head>
<body> 
<div class="order" style="padding-top:0;">
	<div class="productlist">
    	<ul>
        <volist name="goods" id="vo">
        	<eq name="vo.state" value="1">
            <li onClick="window.location='__MODULE__/Exchange/index/gid/{$vo.id}/'">
            <else/>
        	<li></eq>
            	<div class="tit03"><span>商品状态</span>
                <eq name="vo.state" value="0"><b>审核中</b></eq>
                <eq name="vo.state" value="1"><b>兑换中</b></eq>
                <eq name="vo.state" value="2"><b>审核不通过</b></eq>
                <eq name="vo.state" value="4"><b>兑换完</b></eq>
                </div>
            	<div class="pro">
                    <div class="pic"><img src="{$vo.f_img}"/></div>	
                    <div class="name">
                        <h2>{$vo.title} {$vo.u_num}{$vo.unit}</h2>
                        <h3><span>库存：<b>{$vo.num}</b></span></h3>
                        <p>
                        <if condition="$vo['level_cash_1'] gt 0 ">{$vo['level_cash_1']}元</if><if condition="$vo['level_cash_1'] gt 0 and $vo['level_integral_1'] gt 0 ">+</if><if condition="$vo['level_integral_1'] gt 0">{$vo['level_integral_1']}积分</if>
                        </p>
                    </div>
                </div>
                <div class="bot">
                <eq name="vo.state" value="2">
                <input type="button" class="del" sgid="{$vo.id}" value="删除"/>
                <input type="button" onClick="window.location='__MODULE__/StoreExchange/index/id/{$vo.id}/'" value="编辑"/>
                </eq>
                <eq name="vo.state" value="4">
                <input type="button" class="del" sgid="{$vo.id}" value="删除"/>
                <input type="button" onClick="window.location='__MODULE__/StoreExchange/index/id/{$vo.id}/'" value="重新上架"/>
                </eq>
                </div>
        	</li>
		</volist>
        	
            
    	</ul>
	</div>
</div>
<script src="__PUBLIC__/js/jquery.min.js?v=2.1.4"></script>
<script type="text/javascript">
    $('.del').click(function(){
        var dele = $(this);
        var id = dele.attr('sgid');
        $.post('<?=U("StoreExchange/Del")?>',{id:id},function (data) {
            if(!data){
                dele.parents("li").remove();
            }else{
                console.log(data);
            }
        })
    });

</script>

</body>
</html>